package org.alex.samples.model;

import java.io.Serializable;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table( name = "exam_user_subject" )
public class ExamUserSubject  implements Serializable {
	
	private static final long serialVersionUID = 2739253460125247091L;
	
	@Id
	@ManyToOne( cascade = {CascadeType.DETACH,CascadeType.PERSIST,CascadeType.MERGE} )
	@JoinColumn( name = "user_id" )
	private Users userJDBC;
	
	@Id
	@ManyToOne( cascade = {CascadeType.DETACH,CascadeType.PERSIST,CascadeType.MERGE} )
	@JoinColumn( name = "sub_id" )
	private Subject subject;
	
	public ExamUserSubject(){
		super();
	}
	
	public ExamUserSubject(Users userJDBC,Subject subject){
		super();
		this.userJDBC = userJDBC;
		this.subject = subject;
	}

	public Users getUserJDBC() {
		return userJDBC;
	}

	public void setUserJDBC(Users userJDBC) {
		this.userJDBC = userJDBC;
	}

	public Subject getSubject() {
		return subject;
	}

	public void setSubject(Subject subject) {
		this.subject = subject;
	}


	
}
